<?php

class Con_placard extends Acan{
	public $defaultAct='rule';
	public $Conread = '规章制度';
	public $Actread = array('rule'=>'规章制度','rule_manage'=>'规章管理','rule_view'=>'规章查看','message'=>'新闻通知');
	function __construct($ainfo=null){
		parent::__construct($ainfo=null);
		$this->atitle = $this->Actread[$this->Aact];
	}
	function Act_rule(){
		$this->afile = Afunc_file();
		$path = str_replace('\\','/',realpath(A_ROOT.'/upfile/pdf/')).'/';
		$data = $this->afile->ascandiro($path,0,2);
		include $this->Atpl();
	}
	function Act_rule_manage(){
		$this->afile = Afunc_file();
		$path = str_replace('\\','/',realpath(A_ROOT.'/upfile/pdf/')).'/';
		$data = $this->afile->ascandiro($path,0,2);
		include $this->Atpl();
	}
	function Act_rule_view(){
		$ini = array(
			'win'=>array(
				'allowcache' => true,
				'path.pdf' => "E:\Anmp\www\abans\upfile\pdf\\",
				'path.swf' => "E:\Anmp\www\abans\upfile\swf\\",
				'cmd.conversion.singledoc' => "\"C:\Program Files\SWFTools\pdf2swf.exe\" {path.pdf}{pdffile} -o {path.swf}{pdffile}.swf -f -T 9 -t -s storeallcharacters",
				'cmd.conversion.splitpages' => "\"C:\Program Files\SWFTools\pdf2swf.exe\" {path.pdf}{pdffile} -o {path.swf}{pdffile}%.swf -f -T 9 -t -s storeallcharacters -s linknameurl",
				'cmd.searching.extracttext' => "\"C:\Program Files\SWFTools\swfstrings.exe\" {path.swf}{swffile}"
			),
			'linux'=>array(
				'allowcache' => true,
				'path.pdf' => "/Anmp/www/jdoa/upfile/pdf/",
				'path.swf' => "/Anmp/www/jdoa/upfile/swf/",
				'cmd.conversion.singledoc' => "pdf2swf {path.pdf}{pdffile} -o {path.swf}{pdffile}.swf -f -T 9 -t -s storeallcharacters",
				'cmd.conversion.splitpages' => "pdf2swf {path.pdf}{pdffile} -o {path.swf}{pdffile}%.swf -f -T 9 -t -s storeallcharacters -s linknameurl",
				'cmd.searching.extracttext' => "swfstrings {path.swf}{swffile}"
			)
		);
		if(isset($_GET["doc"])) $doc = $_GET["doc"];
		if(isset($_GET["page"])) $page = $_GET["page"];
		if(PHP_OS == "WIN32" || PHP_OS == "WINNT"){
			$config = $ini['win'];
			$charset = 'gb2312';
		}else{
			$config = $ini['linux'];
			$charset = 'utf8';
		}
		if(strlen($page)>0)
			$command = $config['cmd.conversion.splitpages'];
		else
			$command = $config['cmd.conversion.singledoc'];
		$command = str_replace("{path.pdf}",$config['path.pdf'],$command);
		$command = str_replace("{path.swf}",$config['path.swf'],$command);
		$command = str_replace("{pdffile}",$doc,$command);
		$msg = Afun_run_cmd(Afun_charset($command,$charset));
		$swfurl = '/upfile/swf/'.$doc.'.swf';
		include $this->Atpl();
	}
	function Act_message(){
		include $this->Atpl();
	}
}

?>